package controllers;

import play.mvc.Controller;
import play.mvc.Result;
import services.ServiceException;
import services.core.UserService;

public class User extends Controller {
	
	private final static String SESSION_NAME = "VV_SESSION";
	
	public static Result addFavorite(String entity, String id){
		String token = session(SESSION_NAME);
		try {
			UserService.addFavorite(token, entity, id);
			return noContent();
		} catch (ServiceException e) {
			return badRequest(e.getMessage());
		}
	}

}
